#!/bin/bash

echo "正在启动博客系统前端..."
echo

echo "检查 Node.js 版本..."
if ! command -v node &> /dev/null; then
    echo "错误：未找到 Node.js，请先安装 Node.js"
    exit 1
fi

node --version

echo
echo "安装依赖包..."
npm install
if [ $? -ne 0 ]; then
    echo "错误：依赖安装失败"
    exit 1
fi

echo
echo "启动开发服务器..."
echo "应用将在 http://localhost:3000 启动"
echo "按 Ctrl+C 停止服务器"
echo
npm run dev
